﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using IService.DataDLL;
using IService.Model;
using IService.Data;

namespace IService.Business.Manager
{
	public class NewsManager
	{
		public DataTable GetNewsListAll()
		{
			return DTVData.NewsManager.GetNewsListAll(typeof(News));
		}

		public DataTable GetLatestNewsList(int newsnum)
		{
			return DTVData.NewsManager.GetLatestNewsList(typeof(News), newsnum);
		}

		public DataTable GetLatestNewsListByType(int newsnum, int type)
		{
			return DTVData.NewsManager.GetLatestNewsListByType(typeof(News), newsnum, type);
		}

		public DataTable GetNewsListPagin(PagingEntity pe)
		{
			return DTVData.NewsManager.GetNewsListPagin(typeof(News), pe);
		}

		public News GetNewsById(int Id)
		{
			News news = new News();
			news.ID = Id;
			return DTVData.NewsManager.GetNewsById(news);
		}
		/// <summary>
		/// 更新
		/// </summary>
		/// <param name="news"></param>
		/// <returns></returns>
		public bool InsertNews(News news)
		{
			return DTVData.NewsManager.InsertNews(news);
		}

		public bool UpdateNews(News news)
		{
			return DTVData.NewsManager.UpdateNews(news);
		}

		public bool DeleteNews(int Id)
		{
			News news = new News();
			news.ID = Id;
			return DTVData.NewsManager.DeleteNews(news);
		}

		public bool DeleteNewsByIds(string Ids)
		{
			return DTVData.NewsManager.DeleteNewsByIds(typeof(News), Ids);
		}
	}
}
